<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>薪资信息</title>
<link rel="stylesheet" href="../public/layui/css/layui.css" media="all">
<script src="../public/layui/layui.js" charset="utf-8"></script>
<!-- 网页引入echart -->
<script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts.min.js"></script>

<script type="text/javascript">
function createXHR(){
	var xmlhttp;
	if (window.XMLHttpRequest){//支持XMLHttpRequest
	    xmlhttp = new XMLHttpRequest();
	}else{
	    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xmlhttp;
}
function getInfo(){
	//创建XMLHttpRequest对象
	xhr = createXHR();
	//设定请求地址
	var url = "../OrdinaryEmployeesServlet?button=6";
	//建立对服务器的调用
	xhr.open("POST", url, true);
	//指定响应事件处理函数
	xhr.onreadystatechange = function(){
		//当readyState等于4且状态为200时，表示响应已就绪
		if(xhr.readyState ==4 && xhr.status == 200){
			//将响应的JSON格式转换为JavaScript对象
			var data = eval("(" + xhr.responseText + ")");
			document.getElementById("totalwages").value = data[0].totalwages;
			document.getElementById("basewages").value = data[0].basewages;
			document.getElementById("meritwages").value = data[0].meritwages;
			document.getElementById("punishingwages").value = data[0].punishingwages;
			document.getElementById("overtime").value = data[0].overtime;
			document.getElementById("weekovertime").value = data[0].weekovertime;
			document.getElementById("festivalovertime").value = data[0].festovertime;
			document.getElementById("overtimestandard").value = data[0].overtimestandard;
			document.getElementById("commission").value = data[0].commission;
			document.getElementById("festivalwages").value = data[0].festivalwages;
			document.getElementById("yearendwages").value = data[0].yearendwages;
			document.getElementById("leavecount").value = data[0].leavecount;
			document.getElementById("absentcount").value = data[0].absentcount;
			document.getElementById("leavestandard").value = data[0].leavestandard;
			document.getElementById("absentstandard").value = data[0].absentstandard;
		}
	};
	//向服务器发出请求
	xhr.send();
}

</script>
</head>
<body onload="getInfo()">
<%if(session.getAttribute("user")==null){ %>
    <script>
		window.top.location.replace("../login.jsp");
	</script>
<%}%>
<div class="layuimini-container">
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend><h2>我的薪资明细<span style="color:#c2c2c2;font-size:20px">${sessionScope.user.deptname } ${sessionScope.user.rolename }</span></h2></legend>
	</fieldset>
	<div class="layuimini-main">
		<div class="layui-form-item">
	        <label class="layui-form-label required">总薪资：</label>
	        <div class="layui-input-block">
	            <input type="text" id="totalwages" name="totalwages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
		<div class="layui-form-item">
	        <label class="layui-form-label required">基本薪资：</label>
	        <div class="layui-input-block">
	            <input type="text" id="basewages" name="basewages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">奖励与绩效薪资：</label>
	        <div class="layui-input-block">
	            <input type="text" id="meritwages" name="meritwages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">扣罚薪资：</label>
	        <div class="layui-input-block">
	            <input type="text" id="punishingwages" name="punishingwages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    
	    <div class="layui-form-item">
	        <label class="layui-form-label required">加班薪资标准：</label>
	        <div class="layui-input-block">
	            <input type="text" id="overtimestandard" name="overtimestandard" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">普通加班时长：</label>
	        <div class="layui-input-block">
	            <input type="text" id="overtime" name="overtime" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">周末加班时长：</label>
	        <div class="layui-input-block">
	            <input type="text" id="weekovertime" name="weekovertime" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">节假日加班时长：</label>
	        <div class="layui-input-block">
	            <input type="text" id="festivalovertime" name="festivalovertime" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    
	    <div class="layui-form-item">
	        <label class="layui-form-label required">销售提成：</label>
	        <div class="layui-input-block">
	            <input type="text" id="commission" name="commission" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">节日福利：</label>
	        <div class="layui-input-block">
	            <input type="text" id="festivalwages" name="festivalwages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">年终奖金：</label>
	        <div class="layui-input-block">
	            <input type="text" id="yearendwages" name="yearendwages" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    
	    <div class="layui-form-item">
	        <label class="layui-form-label required">迟到次数：</label>
	        <div class="layui-input-block">
	            <input type="text" id="leavecount" name="leavecount" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">迟到扣薪标准：</label>
	        <div class="layui-input-block">
	            <input type="text" id="absentcount" name="absentcount" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">旷工次数：</label>
	        <div class="layui-input-block">
	            <input type="text" id="leavestandard" name="leavestandard" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <label class="layui-form-label required">旷工扣薪标准：</label>
	        <div class="layui-input-block">
	            <input type="text" id="absentstandard" name="absentstandard" class="layui-input" style="width:500px;" disabled="disabled" />
	        </div>
	    </div>
	</div>
</div>
</body>
</html>